package com.hs.srm.admin.modules.requisition.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.hs.srm.base.common.annotation.DictMapping;
import com.hs.srm.base.common.base.CloneableEntity;
import com.hs.srm.base.common.utils.DictDataUtil.DictType;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * @author yangfei
 * @date 2019年2月14日
 * <p>
 * 采购行项目
 */
@Setter
@Getter
@TableName("npro_purch_request_item")
@ToString
public class NproPurchRequestItemEntity implements Serializable, CloneableEntity<NproPurchRequestItemEntity> {

    private static final long serialVersionUID = 1L;

    public static final int STATE_CHUSHI = 0xffffffff;// 初始状态
    public static final int STATE_CAOGAO = 0x00000000;// 草稿
    public static final int STATE_YIBAOJIA = 0x00000001;// 已报价
    public static final int STATE_SHENHEZHONG = 0x00000002;// 审核中
    public static final int STATE_SHENHETONGGUO = 0x00000003;// 审核通过
    public static final int STATE_SHENHEBOHUI = 0xfffffffd;// 审核驳回

    public static final int CAOGAO = -2;// 草稿
    public static final int YIBAOJIA = 4;// 供应商已报价

    public NproPurchRequestItemEntity() {
        super();
    }

    /*
     * PKID
     */
    @TableId(value = "pk_id", type = IdType.UUID)
    @Excel(name = "PKID", orderNum = "1")
    private java.lang.String pkId;

    /*
     * 采购申请编码
     */
    @TableField("purch_request_code")
    @Excel(name = "采购申请编码", orderNum = "2")
    private java.lang.String purchRequestCode;

    /*
     * 采购申请项目编码
     */
    @TableField("purch_request_item_code")
    @Excel(name = "采购申请编码", orderNum = "3")
    private java.lang.String purchRequestItemCode;

    /*
     * 科目类别
     */
    @TableField("subject_category")
    @Excel(name = "科目类别", orderNum = "4")
    private java.lang.String subjectCategory;

    /*
     * 采购组
     */
    @TableField("purch_group")
    @Excel(name = "采购组", orderNum = "5")
    @DictMapping(type = DictType.CGZ)
    private java.lang.String purchGroup;

    /*
     * 采购组织
     */
    @TableField("purch_org")
    @Excel(name = "采购组织", orderNum = "6")
    @DictMapping(type = DictType.CGZZ)
    private java.lang.String purchOrg;

    /*
     * 申请者
     */
    @TableField("applier")
    @Excel(name = "申请者", orderNum = "7")
    private java.lang.String applier;

    /*
     * 使用者
     */
    @TableField("use_people")
    @Excel(name = "使用者", orderNum = "7")
    private java.lang.String usePeople;

    /*
     * 物料描述
     */
    @TableField("material_desc")
    @Excel(name = "物料描述", orderNum = "8")
    private java.lang.String materialDesc;

    /*
     * 工厂
     */
    @TableField("factory")
    @Excel(name = "工厂", orderNum = "9")
    @DictMapping(type = DictType.GC)
    private java.lang.String factory;

    /*
     * 库存地点
     */
    @TableField("storage_location")
    @Excel(name = "库存地点", orderNum = "10")
    @DictMapping(type = DictType.KCDD)
    private java.lang.String storageLocation;

    /*
     * 物料组
     */
    @TableField("material_group")
    @Excel(name = "物料组", orderNum = "11")
    @DictMapping(type = DictType.WLZ)
    private java.lang.String materialGroup;

    /*
     * 申请数量
     */
    @TableField("apply_qty")
    @Excel(name = "申请数量", orderNum = "12")
    private java.math.BigDecimal applyQty;

    /*
     * 计量单位
     */
    @TableField("measure_unit")
    @Excel(name = "计量单位", orderNum = "13")
    @DictMapping(type = DictType.JLDW)
    private java.lang.String measureUnit;

    /*
     * 成本中心
     */
    @TableField("cost_center")
    @Excel(name = "成本中心", orderNum = "14")
    @DictMapping(type = DictType.CBZX)
    private java.lang.String costCenter;

    /*
     * 内部订单号
     */
    @TableField("internal_order_code")
    @Excel(name = "内部订单号", orderNum = "15")
    private java.lang.String internalOrderCode;

    /*
     * 主资产号
     */
    @TableField("main_assets_code")
    @Excel(name = "主资产号", orderNum = "16")
    private java.lang.String mainAssetsCode;

    /*
     * 资产次级编号
     */
    @TableField("assets_sencond_code")
    @Excel(name = "资产次级编号", orderNum = "17")
    private java.lang.String assetsSencondCode;

    /*
     * 需求日期
     */
    @TableField("request_date")
    @Excel(name = "需求日期", orderNum = "18")
    //@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date requestDate;

    /**
     * 交货日期
     */
    @TableField("delivery_date")
    @Excel(name = "交货日期", orderNum = "19")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date deliveryDate;

    /**
     * 交货地址
     */
    @TableField("delivery_address")
    @Excel(name = "交货地址", orderNum = "20")
    @DictMapping(type = DictType.SAPSHDZ)
    private java.lang.String deliveryAddress;

    /**
     * 备注
     */
    @TableField("remark")
    @Excel(name = "备注", orderNum = "21")
    private java.lang.String remark;

    /*
     * 附件
     */
    @TableField("attachment")
    private java.lang.String attachment;

    /*
     * 货源状态
     */
    @TableField("goods_status")
    @Excel(name = "货源状态", orderNum = "23")
    private Integer goodsStatus;

    /*
     * 供应商编码
     */
    @TableField("vendor_code")
    @Excel(name = "供应商编码", orderNum = "24")
    private java.lang.String vendorCode;

    /*
     * 供应商名称
     */
    @TableField("vendor_name")
    @Excel(name = "供应商名称", orderNum = "25")
    private java.lang.String vendorName;

    /*
     * 含税单价
     */
    @TableField("tax_price")
    @Excel(name = "含税单价", orderNum = "26")
    private java.math.BigDecimal taxPrice;

    /*
     * 价格单位
     */
    @TableField("price_unit")
    @Excel(name = "价格单位", orderNum = "27")
    private java.lang.String priceUnit;

    /*
     * 货币
     */
    @TableField("currency")
    @Excel(name = "货币", orderNum = "28")
    @DictMapping(type = DictType.BZ)
    private java.lang.String currency;

    /*
     * 税码
     */
    @TableField("tax_code")
    @Excel(name = "税码", orderNum = "29")
    @DictMapping(type = DictType.SDM)
    private java.lang.String taxCode;

    /*
     * 行项目UUID
     */
    @TableField("uuid")
    @Excel(name = "行项目UUID", orderNum = "30")
    private java.lang.String uuid;

    /*
     * 采购订单号
     */
    @TableField("po_no")
    @Excel(name = "采购订单号", orderNum = "31")
    private java.lang.String poNo;

    /*
     * 采购订单行项目号
     */
    @TableField("item_no")
    @Excel(name = "采购订单行项目号", orderNum = "32")
    private java.lang.String itemNo;

    /*
     * 总账科目
     */
    @TableField("ledger_account")
    @Excel(name = "", orderNum = "33")
    private java.lang.String ledgerAccount;

    /*
     * 删除标志
     */
    @TableField("delete_flag")
    @Excel(name = "删除标志", orderNum = "34")
    private java.lang.String deleteFlag;

    /*
     *
     */
    @TableField("specification_type")
    @Excel(name = "规格型号", orderNum = "35")
    private java.lang.String specificationType;

    /*
     *
     */
    @TableField("count")
    @Excel(name = "合计", orderNum = "36")
    private java.math.BigDecimal count;

    /*
     *
     */
    @TableField("purpose")
    @Excel(name = "用途", orderNum = "37")
    private java.lang.String purpose;

    /*
     *
     */
    @TableField("version")
    @Excel(name = "", orderNum = "38")
    private Integer version;

    /*
     * 创建人
     */
    @TableField("created_by")
    @Excel(name = "创建人", orderNum = "45")
    private java.lang.String createdBy;

    /*
     * 创建日期
     */
    @TableField("creation_date")
    @Excel(name = "创建日期", orderNum = "46")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date creationDate;

    /*
     * 修改人
     */
    @TableField("last_updated_by")
    @Excel(name = "修改人", orderNum = "47")
    private java.lang.String lastUpdatedBy;

    /*
     * 修改日期
     */
    @TableField("last_update_date")
    @Excel(name = "修改日期", orderNum = "48")
    private java.sql.Date lastUpdateDate;


    /*
     * 物料号
     */
    @TableField("material_code")
    @Excel(name = "物料号", orderNum = "49")
    private java.lang.String materialCode;

    /**
     * 部门
     */
    @TableField(exist = false)
    private java.lang.String purchRequestDept;


    /**
     * SRM收到申请单日期
     */
    @TableField(exist = false)
    @JSONField(format = "yyyy-MM-dd")
    private Date srmReceiveDate;

    /**
     * 申请人
     */
    @TableField(exist = false)
    private java.lang.String purch_request_staff;

    @TableField(exist = false)
    private NproPurchRequestHeaderEntity nproPurchRequestHeaderEntity;

    @Override
    public NproPurchRequestItemEntity clone() {
        try {
            return (NproPurchRequestItemEntity) super.clone();
        } catch (CloneNotSupportedException ex) {
            // TODO Auto-generated catch block
            ex.printStackTrace();
        }
        return null;
    }
}
